package day4;

/**
 * @author oldliu
 * @since 1.0
 */
public class Company {
    String name;
    String addr;
    String tele;
    String scope;//经营范围
    String[] emps = new String[30];

    //招聘新员工
    public void hire(String newEmp) {
        for (int i = 0; i < emps.length; i++) {
            if (emps[i] == null) {
                emps[i] = newEmp;
                break;
            }
        }
    }

    //显示公司信息
    public void show() {
        System.out.println("这个公司叫" + name);
        System.out.println("位于" + addr + ",电话是" + tele);
        System.out.println("经营范围是" + scope);
        System.out.println("员工信息如下：");
        //System.out.println(emps);
        for (int i = 0; i < emps.length; i++) {
            if (emps[i] == null)
                break;
            System.out.print(emps[i] + "\t");
        }
        System.out.println();
    }
}
